<ion-view id="tab-home" show-tabs>
  <ion-nav-bar class="bar-royal">
    <ion-nav-title><img class="tab-home__logo" src="img/app/logo-negative.svg"></ion-nav-title>
  </ion-nav-bar>

  <ion-content>
    <ion-refresher
     ng-if="isAndroid"
     pulling-icon="ion-ios-refresh"
     spinner="ios-small"
     on-refresh="onRefresh()">
   </ion-refresher>

   <div class="list card important-message ng-hide" ng-show="serverMessage">
     <div class="close-button" ng-click="serverMessage = null"><i class="icon ion-ios-close-empty"></i></div>
     <i class="item big-icon-svg">
       <img src="img/alert.svg" width="50" />
     </i>

     <div class="item alert">{{serverMessage.title}}</div>
     <div class="item message">{{serverMessage.body}}</div>

     <div class="button" ng-click="openServerMessageLink()">
       <span translate>Learn more</span>
     </div>
   </div>

    <div class="list card important-message ng-hide" ng-show="newRelease">
      <i class="item icon big-icon-svg">
        <img src="img/icon-update.svg" class="bg"/>
      </i>

      <div class="item title">{{updateText}}</div>

      <div class="button" ng-click="goToDownload()">
        <span translate>Download</span>
      </div>
    </div>

<!--    <div class="ng-hide" ng-show="showRateCard.value" ng-include="'views/feedback/rateCard.html'"></div> -->
    <div class="list card homeTip" ng-if="homeTip">
      <div class="item item-icon-right item-heading">
        <a ng-click="hideHomeTip()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
      </div>
      <div>
        <i class="icon big-icon-svg">
          <img src="img/check-white.svg" class="bg green"/>
        </i>
      </div>
      <div class="title" translate>
        Your wificoin wallet is ready!
      </div>
      <div class="subtitle" translate>
        On this screen you can see all your wallets, accounts, and assets.
      </div>
    </div>
 
    <div class="list card" ng-hide="!wifiPortalPayState">
      <a class="item item-icon-right item-heading">
        {{wifiPortalPayTitle}}
      </a>

      <div ng-click="sendPortalPayment()">
        <a class="wallet-details__item item item-sub">
            <div style="padding-right: 25px">
              <img src="img/icon-wifi-portal.svg" width="40">
            </div>

            <div class="wallet-details__tx-content" ng-class="{'no-border': $last}">
              <div class="wallet-details__tx-title">
                <span>
                  <span class="ellipsis" translate>Waiting for pay</span>
                </span>
              </div>

              <span class="item-note text-right wallet-details__tx-amount">
                <span class="wallet-details__tx-amount wallet-details__tx-amount--sent">
                  <span>
                  – {{wifiPortalPayAmount}} WFC
                  </span>
                </span>
                <div>
                  <time class="wallet-details__tx-time" ng-if="wifiPortalPaytime && createdWithinPastDay(wifiPortalPaytime * 1000)">{{wifiPortalPaytime * 1000| amTimeAgo}}</time>
                  <time class="wallet-details__tx-time" ng-if="wifiPortalPaytime && !createdWithinPastDay(wifiPortalPaytime * 1000)">{{wifiPortalPaytime * 1000| date:'MMMM d, y'}}</time>
                </div>
              </span>
            </div>
        </a>
      </div>
    </div>
		
		<div class="list card">
      <div class="item item-icon-right item-heading">
        <span translate>Talkblock community</span>
      </div>
      <div>
      <a ng-click="openExternalLink('https://talkblock.org')" class="item item-sub item-icon-left item-big-icon-left">
        <i class="icon big-icon-svg">
          <img src="img/icon-talkblock.svg" class="bg"/>
        </i>
        <span translate>Talkblock</span>
        <p>
          <span class="ng-binding" translate>Blockchian BBS</span>
          &nbsp;
        </p>
      </a>
      </div>
    </div>

    <div class="list card" ng-hide="!txps[0]">
      <a class="item item-icon-right item-heading" ui-sref="tabs.proposals">
        {{'Payment Proposals'|translate}}
        <i class="icon bp-arrow-right"></i>
        <span class="badge badge-assertive m5t m10r" ng-show="txpsN>3"> {{txpsN}}</span>
      </a>

      <div ng-repeat="tx in txps" ng-click="openTxpModal(tx)">
        <a class="wallet-details__item item item-sub" ng-include="'views/includes/txp.html'"></a>
      </div>
    </div>

    <div class="list card" ng-if="notifications[0] && recentTransactionsEnabled">
      <a class="item item-icon-right item-heading" ui-sref="tabs.activity">
        <span translate>Recent Transactions</span>
        <i class="icon bp-arrow-right"></i>
        <span class="badge badge-assertive m5t m10r" ng-show="notificationsN>3"> {{notificationsN}}</span>
      </a>
      <a class="item item-sub activity" ng-repeat="notification in notifications" ng-click="openNotificationModal(notification)">
        <span ng-include="'views/includes/walletActivity.html'"></span>
      </a>
    </div>

    <div class="list card" ng-if="!walletsBtc[0] && !walletsBch[0]">
      <div class="item item-icon-right item-heading">
        <span translate>Wallets</span>
      </div>
      <a ui-sref="tabs.add" class="item item-icon-left item-big-icon-left item-icon-right">
        <i class="icon big-icon-svg">
          <img src="img/icon-wallet.svg" class="bg wallet icon-create-wallet"/>
        </i>
        <span translate>Create wificoin wallet</span>
        <i class="icon bp-arrow-right"></i>
      </a>
    </div>

    <div class="list card" ng-if="walletsBtc[0]">
      <div class="item item-icon-right item-heading">
        <img class="wallet-coin-logo" src="img/icon-bitcoin.svg" width="18">
        <span translate>Wificoin Wallets</span>
        <a ui-sref="tabs.add"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
      </div>
      <div>
        <a ng-repeat="wallet in walletsBtc track by $index"
           class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
           ng-click="openWallet(wallet)">
          <span ng-include="'views/includes/walletList.html'"></span>
        </a>
      </div>
    </div>

    <div class="list card" ng-if="walletsBch[0]">
      <div class="item item-icon-right item-heading">
        <img class="wallet-coin-logo" src="img/bitcoin-cash-logo.svg" width="22">
        <span translate>Wificoin Cash Wallets</span>
        <a ui-sref="tabs.add({coin:'bch'})"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
      </div>
      <div>
        <a ng-repeat="wallet in walletsBch track by $index"
           class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
           ng-click="openWallet(wallet)">
          <span ng-include="'views/includes/walletList.html'"></span>
        </a>
      </div>
    </div>

    <div class="ng-hide list card" ng-show="walletsBtc[0] && bitpayCardItems.length>0" ng-include="'views/includes/bitpayCardsCard.html'"></div>
    <div class="ng-hide list card" ng-show="walletsBtc[0] && buyAndSellItems.length>0" ng-include="'views/includes/buyAndSellCard.html'"></div>
    <div class="ng-hide list card" ng-show="homeIntegrations.length>0" ng-include="'views/includes/homeIntegrations.html'"></div>

  </ion-content>
</ion-view>
